
// 定义路由规则中的类型
interface IBestAFSRoute {
  path: string,
  component?: string,
  name?: string, // 兼容此写法
  icon?: string,
  routes?: IBestAFSRoute[],
  // 更多功能查看
  // https://beta-pro.ant.design/docs/advanced-menu
  // ---
  // 新页面打开
  target?: string,
  // 不展示顶栏
  headerRender?: boolean,
  // 不展示页脚
  footerRender?: boolean,
  // 不展示菜单
  menuRender?: boolean,
  // 不展示菜单顶栏
  menuHeaderRender?: boolean,
  // 权限配置，需要与 plugin-access 插件配合使用
  access?: string,
  // 隐藏子菜单
  hideChildrenInMenu?: boolean,
  // 隐藏自己和子菜单
  hideInMenu?: boolean,
  // 在面包屑中隐藏
  hideInBreadcrumb?: boolean,
  // 子项往上提，仍旧展示,
  flatMenu?: boolean,
}

const routes: IBestAFSRoute[] = [
  { path: '/', component: '@/pages/home', name: '系统首页' },
  { path: '/login', component: '@/pages/login', headerRender: false, menuRender: false, footerRender: false },
  {
    path: '/banner',
    name: '轮播图管理',
    routes: [
      {
        path: '/banner/list',
        component: '@/pages/banner/index',
        name: '轮播图列表'
      },
      {
        path: '/banner/add',
        component: '@/pages/banner/add',
        name: '添加轮播图'
      }
    ]
   },
  {
    path: '/pro',
    name: '商品管理',
    routes: [
      {
        path: '/pro/list',
        component: '@/pages/pro',
        name: '商品列表'
      },
      {
        path: '/pro/search',
        component: '@/pages/pro/search',
        name: '筛选列表'
      }
    ]
  },
]

export default routes
